Method and apparatus for encoding/decoding image information

ABSTRACT

The present invention relates to a deblocking filtering method, a method for inducing bs (boundary strength) therefor, and a method and an apparatus for encoding/decoding using the same. The method for inducing the bS of the present invention comprises the steps of: inducing a boundary of a deblocking filtering unit block as a unit block for applying the deblocking filtering; and setting the bS according to each bS setting unit block within the deblocking filtering unit block, wherein the bS setting step can set a bS value for a target boundary corresponding to a boundary of the deblocking filtering unit block as the bs setting unit block.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of U.S. application Ser. No.14/220,753, filed on Mar. 20, 2014, which is a Continuation ofInternational Application PCT/KR2012/007468, filed on Sep. 18, 2012,which claims the benefit of U.S. Provisional Application No. 61/537,029,filed on Sep. 20, 2011, and U.S. Provisional Application No. 61/545,594,filed on Oct. 11, 2011, the entire contents of which are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

The present invention relates to a video information compressiontechnique, and more particularly, to a method of applying a deblockingfilter as an in-loop filter.

BACKGROUND ART

Recently, demands for a high-resolution and high-quality video haveincreased in various fields of applications. As an image has higherresolution and higher quality, an amount of data on the video increasesmore.

Accordingly, when image data is transferred using media such as existingwired or wireless broadband lines or video data is stored in existingstorage media, the information transfer cost and the information storagecost increase.

High-efficiency video compressing techniques can be used to effectivelytransfer, store, and reproduce information on high-resolution andhigh-quality videos.

Inter prediction and intra prediction can be used to enhance videocompression efficiency. In the inter prediction, pixel values of acurrent picture are predicted using information of other pictures. Inthe intra prediction, the pixel values are predicted using inter-pixelrelationships in the same picture.

Various methods for making a video equal to an original video can beapplied to a processing unit of a predicted picture, for example, ablock. Accordingly, a decoder can decode a video more accurately (moreclosely to an original video), and an encoder can encode a video toreconstruct the video more accurately.

SUMMARY OF INVENTION Technical Problem

An object of the present invention is to provide a method and anapparatus which can reconstruct an image to be close to an originalimage by effectively removing deblocking artifacts in application ofdeblocking filtering.

Another object of the present invention is to provide a method and anapparatus which can enhance compression efficiency by reducingcomplexity in application of deblocking filtering.

Still another object of the present invention is to provide a method andan apparatus which can reduce complexity by effectively setting a unitblock for deciding a bS (boundary strength) value in application ofdeblocking filtering.

Still another object of the present invention is to provide a method andan apparatus which can reduce complexity by effectively setting a bSvalue in application of deblocking filtering.

Technical Solution

According to an aspect of the invention, there is provided a boundarystrength (bS) deriving method including the steps of deriving a boundaryof a deblocking filtering unit block which is a unit block on whichdeblocking filtering is performed; and setting a bS for each bS settingunit block in the deblocking filtering unit block, wherein the step ofsetting the bS includes setting a bS value of a target boundarycorresponding to the boundary of the deblocking filtering unit block asthe bS setting unit block.

The step of setting the bS may include setting the bS value of thetarget boundary to bS2 in a case that at least one of two blocks withthe target boundary as a boundary is intra-coded; setting the bS valueof the target boundary to bS1 in a case that the target boundary is adeblocking filtering target and not in the case that at least one of twoblocks with the target boundary as a boundary is intra-coded; andsetting the bS value of the target boundary to bS0 in a case that thetarget boundary is not a deblocking filtering target, and the values ofbS0, bS1, and bS2 satisfy a relationship of bS0<bS1<bS2.

The case in which the bS is set to bS1 may not be a case in which atleast one of two blocks with the target boundary as a boundary isintra-coded and may include: a case in which at least one of the atleast one of two blocks with the target boundary as a boundary includesa transform coefficient other than 0; and a case in which the two blockswith the target boundary as a boundary have different reference picturesor different motion vectors.

The step of deriving the boundary of the deblocking filtering unit blockand the step of setting the bS may be first performed on vertical edgesin a picture including the deblocking filtering unit block and may bethen performed on horizontal edges in the picture including thedeblocking filtering unit blocks.

The deblocking filtering unit block may be any one of a coding block, atransform block, a prediction block, and an 8×8 pixel block. The bSsetting unit block may be a 4×4 pixel block.

According to another aspect of the invention, there is provided adeblocking filtering method including the steps of: setting a boundarystrength (bS) of a target boundary by bS setting unit blocks; andapplying deblocking filtering on the target boundary by deblockingfiltering unit blocks, wherein the step of setting the bS includessetting the bS value of the target boundary corresponding to thedeblocking filtering unit block as the boundary of the bS setting unitblock.

The step of setting the bS may include setting the bS value of thetarget boundary to bS2 in a case that at least one of two blocks withthe target boundary as a boundary is intra-coded; setting the bS valueof the target boundary to bS1 in a case that the target boundary is adeblocking filtering target and not in the case that at least one of twoblocks with the target boundary as a boundary is intra-coded; andsetting the bS value of the target boundary to bS0 when the targetboundary is not a deblocking filtering target, and the values of bS0,bS1, and bS2 satisfy a relationship of bS0<bS1<bS2.

The case in which the bS is set to bS1 may not be a case in which atleast one of two blocks with the target boundary as a boundary isintra-coded and may include: a case in which at least one of the atleast one of two blocks with the target boundary as a boundary includesa transform coefficient other than 0; and a case in which the two blockswith the target boundary as a boundary have different reference picturesor different motion vectors.

The step of deriving the boundary of the deblocking filtering unit blockand the step of setting the bS may be first performed on vertical edgesin a picture including the deblocking filtering unit block and may bethen performed on horizontal edges in the picture including thedeblocking filtering unit blocks.

When the bS value set for the target boundary is larger than bS0 and thedeblocking filtering is performed thereon, it may be determined which ofstrong filtering and weak filtering should be performed.

The determination on which of strong filtering and weak filtering shouldbe performed may be performed on the basis of samples of the two blockswith the target boundary as a boundary, may be performed on the basis ofsamples to be subjected to the deblocking filtering out of samples insample rows with the target boundary as a boundary when the targetboundary is a vertical edge, and may be performed on the basis ofsamples to be subjected to the deblocking filtering out of samples insample columns with the target boundary as a boundary when the targetboundary is a horizontal edge.

When it is determined that the weak filtering should be performed, thefiltering may be performed on the samples selected from the samples tobe subjected to the deblocking filtering.

The deblocking filtering unit block may be any one of a coding block, atransform block, a prediction block, and an 8×8 pixel block. The bSsetting unit block may be a 4×4 pixel block.

Advantageous Effects

According to the aspects of the present invention, it is possible toreconstruct an image to be close to an original image by effectivelyremoving deblocking artifacts in application of deblocking filtering.

According to the aspects of the present invention, it is possible toenhance compression efficiency by reducing complexity in application ofdeblocking filtering.

According to the aspects of the present invention, it is possible toreduce complexity by effectively setting a unit block for deciding a bS(boundary strength) value in application of deblocking filtering.According to the aspects of the present invention, it is also possibleto reduce complexity by effectively setting a bS value in application ofdeblocking filtering.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram schematically illustrating an encodingapparatus (video encoder) according to an embodiment of the invention.

FIG. 2 is a block diagram schematically illustrating a video decoderaccording to an embodiment of the invention.

FIG. 3 is a flowchart schematically illustrating a method of applying adeblocking filter according to the invention.

FIG. 4 is a diagram schematically illustrating details of deblockingfiltering according to the invention.

FIG. 5 is a flowchart illustrating schematically illustrating an exampleof a bS decision method.

FIG. 6 is a diagram illustrating a target boundary of deblockingfiltering when a deblocking filter unit block is a 8×8 pixel block and abS setting unit block is a 4×4 pixel block.

FIG. 7 is a diagram schematically illustrating an example of a method ofdeciding a representative bS value in a unit block on which deblockingfiltering is performed.

FIG. 8 is a diagram schematically illustrating another example of themethod of deciding a representative bS value in a unit block on whichdeblocking filtering is performed.

FIG. 9 is a flowchart schematically illustrating another example of thebS decision method.

FIG. 10 is a flowchart schematically illustrating another example of thebS decision method.

FIG. 11 is a flowchart schematically illustrating the bS decision methodas an example of a bS decision tree which is used to applying an OMBC.

FIG. 12 is a flowchart schematically illustrating the bS decision methodas another example of the bS decision tree which is used to applying anOMBC.

FIG. 13 is a diagram schematically illustrating an example of a methodof deciding a bS and applying deblocking filtering.

FIG. 14 is a diagram schematically illustrating another example of amethod of deciding a bS and applying deblocking filtering.

FIGS. 15 and 16 are flowcharts schematically illustrating examples of amethod of deciding a representative bS.

FIG. 17 is a flowchart schematically illustrating a video encodingmethod according to the invention.

FIG. 18 is a flowchart schematically illustrating a video decodingmethod according to the invention.

MODE FOR INVENTION

The present invention can be variously modified in various forms, andspecific embodiments thereof will be described and shown in thedrawings. However, the embodiments are not intended for limiting theinvention. The terms used in the following description are used tomerely describe specific embodiments, but are not intended to limit theinvention. An expression of a singular number includes an expression ofthe plural number, so long as it is clearly read differently. The termssuch as “include” and “have” are intended to indicate that features,numbers, steps, operations, elements, components, or combinationsthereof used in the following description exist and it should be thusunderstood that the possibility of existence or addition of one or moredifferent features, numbers, steps, operations, elements, components, orcombinations thereof is not excluded.

On the other hand, elements in the drawings described in the inventionare independently drawn for the purpose of convenience for explanationof different specific functions in a video encoding/decoding apparatusand does not mean that the elements are embodied by independent hardwareor independent software. For example, two or more elements of theelements may be combined to form a single element, or one element may bedivided into plural elements. The embodiments in which the elements arecombined and/or divided belong to the scope of the invention withoutdeparting from the concept of the invention.

Hereinafter, exemplary embodiments of the invention will be described indetail with reference to the accompanying drawings. Like constituents inthe drawings will be referenced by like reference numerals and will notbe repeatedly described.

FIG. 1 is a block diagram schematically illustrating an encodingapparatus (video encoder) according to an embodiment of the invention.Referring to FIG. 1, a video encoding apparatus 100 includes a picturedividing module 105, a prediction module 110, a transform module 115, aquantization module 120, a rearrangement module 125, an entropy encodingmodule 130, an &quantization module 135, an inverse transform module140, a filter module 145, and a memory 150.

The picture dividing module 105 can divide an input picture into atleast one processing unit blocks. Here, a block as a processing unit maybe a prediction unit (hereinafter, referred to as a “PU”), a transformunit (hereinafter, referred to as a “TU”), or a coding unit(hereinafter, referred to as a “CU”).

The prediction module 110 includes an inter prediction module thatperforms an inter prediction process and an intra prediction module thatperforms an intra prediction process, as described later. The predictionmodule 110 performs a prediction process on the processing units of apicture divided by the picture dividing module 105 to generate aprediction block. In the prediction module 110, the processing unit of apicture may be a CU, a TU, or a PU. The prediction module 110 candetermine whether the prediction performed on the correspondingprocessing unit is an inter prediction or an intra prediction, and candetermine specific details (for example, a prediction mode) of theprediction methods. The processing unit subjected to the predictionprocess may be different from the processing unit of which theprediction method and the specific details are determined. For example,the prediction method and the prediction mode may be determined in theunits of PU and the prediction process may be performed in the units ofTU.

In the inter prediction, a prediction process is performed on the basisof information on at least one of a previous picture and/or a subsequentpicture of a current picture to generate a prediction block. In theintra prediction, a prediction process is performed on the basis ofpixel information of a current picture to generate a prediction block.

In the inter prediction, a skip mode, a merge mode, an MVP (MotionVector Prediction) mode, and the like can be used. In the interprediction, a reference picture is selected for a PU, and a referenceblock having the same size as the PU can be selected by integer pixelsamples. Then, a prediction block in which a residual signal from thecurrent PU is minimized and the motion vector magnitude is minimized isgenerated.

The prediction block may be generated in the unit of integer pixelsamples or in the unit of pixel samples less than an integer pixel suchas ½ pixel samples and ¼ pixel samples. Here, the motion vector can alsobe expressed in the unit of pixel samples less than an integer pixel.For example, luma pixels can be expressed in the unit of ¼ pixels andchroma pixels can be expressed in the unit of ⅛ pixels.

Information such as an index, a motion vector (for example, a motionvector predictor), and a residual signal of a reference picture selectedthrough the inter prediction is entropy-encoded and is transmitted to adecoder. When the skip mode is applied, a prediction block can be usedas a reconstructed block and thus the residual signal may not begenerated, transformed, quantized, and transmitted at all.

When the intra prediction is performed, the prediction mode can bedetermined in the unit of PU and the prediction process can be performedin the unit of PU. Alternatively, the prediction mode may be determinedin the unit of PU and the inter prediction may be performed in the unitof TU.

The prediction modes in the intra prediction include 33 directionalprediction modes and at least two non-directional modes. Thenon-directional modes include a DC prediction mode and a planar mode.

In the intra prediction, a prediction block can be generated after afilter is applied to a reference sample. At this time, it can bedetermined whether a filter should be applied to a reference sampledepending on the intra prediction mode and/or the size of a currentblock.

A PU has various sizes and shapes. For example, in case of interprediction, a PU may be blocks having sizes such as 2N×2N, 2N×N, N×2N,and N×N (where N is an integer). In case of intra prediction, a PU maybe blocks having sizes such as 2N×2N and N×N (where N is an integer). APU with a size of N×N can be set to be applied to only a specific case.For example, the PU with a size of N×N can be set to be used for only asmallest CU or can be set to be used for only the intra prediction. Inaddition to the PUs with the above-mentioned sizes, PUs such as an N×mNblock, an mN×N block, a 2N×mN block, and an mN×2N block (where m<1) maybe additionally defined and used.

Residual values (a residual block or a residual signal) between thegenerated prediction block and the original block are input to thetransform module 115. The prediction mode information, the motion vectorinformation, and the like used for the prediction are encoded along withthe residual values by the entropy encoding module 130 and aretransmitted to the decoder.

The transform module 115 performs a transform process on the residualblock in the unit of TU and generates transform coefficients. Thetransform unit in the transform module 115 may be a TU and may have aquad tree structure. The size of the transform unit can be determinedwithin a predetermined largest and smallest size range. The transformmodule 115 can transform the residual block using DCT (Discrete CosineTransform) and/or DST (Discrete Sine Transform).

The quantization module 120 can quantize the residual values transformedby the transform module 115 and can generate quantization coefficients.The values calculated by the quantization module 120 can be provided tothe dequantization module 135 and the rearrangement module 125.

The rearrangement module 125 can rearrange the quantization coefficientsprovided from the quantization module 120. By rearranging thequantization coefficients, it is possible to enhance the encodingefficiency in the entropy encoding module 130. The rearrangement module125 can rearrange the quantization coefficients in the form of atwo-dimensional block to the form of a one-dimensional vector throughthe use of a coefficient scanning method. The rearrangement module 125can enhance the entropy encoding efficiency in the entropy encodingmodule 130 by changing the order of coefficient scanning on the basis ofstochastic statistics of the coefficients transmitted from thequantization module.

The entropy encoding module 130 performs an entropy encoding process onthe quantization coefficients rearranged by the rearrangement module125. Examples of the entropy encoding method include an exponentialgolomb method, a CAVLC (Context-Adaptive Variable Length Coding) method,and a CABAC(Context-Adaptive Binary Arithmetic Coding) method. Theentropy encoding module 130 can encode a variety of information such asresidual coefficient information and block type information of a codingunit, prediction mode information, dividing unit information, predictionunit information, transfer unit information, motion vector information,reference picture information, block interpolation information, andfiltering information transmitted from the rearrangement module 125 andthe prediction module 110.

The entropy encoding module 130 may give a predetermined change to aparameter set or a syntax to be transmitted, if necessary.

The dequantization module 135 dequantizes the values quantized by thequantization module 120. The inverse transform module 140 inverselytransforms the values inversely quantized by the dequantization module135. The residual values generated by the dequantization module 135 andthe inverse transform module 140 are merged with the prediction blockpredicted by the prediction module 110 to generate a reconstructedblock.

In FIG. 1, a residual block and a prediction block are added to generatea reconstructed block by an adder. At this time, the adder may beconsidered as a particular module (reconstructed block creating module)that generates a reconstructed block.

The filter module 145 applies a deblocking filter, an ALF (Adaptive LoopFilter), an SAO (Sample Adaptive Offset) to the reconstructed picture.

The deblocking filter removes a block distortion generated at theboundary between blocks in the reconstructed picture. The ALF performs afiltering process on the basis of the result values of the comparison ofthe original picture with the reconstructed picture of which the blocksare filtered by the deblocking filter. The ALF may be applied only whenhigh efficiency is necessary. The SAO reconstructs offset differencesbetween the residual blocks having the deblocking filter applied theretoand the original picture and is applied in the form of a band offset, anedge offset, or the like.

On the other hand, the filter module 145 may not perform a filteringprocess on a reconstructed block used for the inter prediction.

The memory 150 stores the reconstructed block or picture calculated bythe filter module 145. The reconstructed block or picture stored in thememory 150 is provided to the prediction module 110 that performs theinter prediction.

FIG. 2 is a block diagram schematically illustrating a video decodingapparatus according to an embodiment of the invention. Referring to FIG.2, a video decoding apparatus 200 includes an entropy decoding module210, a rearrangement module 215, an dequantization module 220, aninverse transform module 225, a prediction module 230, a filter module235, and a memory 240.

When a video bitstream is input from the video encoding apparatus, theinput bitstream is decoded on the basis of the order in which videoinformation is processed by the video encoding apparatus.

For example, when the image encoding device uses a variable lengthcoding (hereinafter, referred to as “VLC”) method such as the CAVLC toperform the entropy encoding process, the video decoding module 210 canrealize the same VLC table as used in the video encoding device and canperform the entropy decoding process. When the video encoding deviceuses the CABAC to perform the entropy encoding process, the entropydecoding module 210 can perform the entropy decoding process using theCABAC to correspond thereto.

Information for creating a prediction block out of the informationdecoded by the entropy decoding module 210 is provided to the predictionmodule 230, and the residual values entropy-decoded by the entropydecoding module are input to the rearrangement module 215.

The rearrangement module 215 rearranges the bitstream entropy-decoded bythe entropy decoding module 210 on the basis of the rearrangement methodin the video encoding device. The rearrangement module 215 reconstructsand rearranges coefficients expressed in the form of one-dimensionalvector into coefficients of a two-dimensional block form. Therearrangement module 215 is provided with information associated withthe coefficient scanning performed by the encoding module and canperform the rearrangement using a method of inversely scanning thecoefficients on the basis of the scanning order in which the scanning isperformed by the corresponding encoding module.

The dequantization module 220 performs dequantization on the basis ofthe quantization parameters provided from the encoder and the rearrangedcoefficient values of the block.

The inverse transform module 225 performs the inverse DCT and inverseDST of the DCT and DST, which has been performed by the transform moduleof the video encoding device, on the quantization result from the videoencoding device. The inverse transform is performed on the basis of atransfer unit or a division unit of a picture determined by the videoencoding device. The transform module of the video encoding deviceselectively performs the DCT and DST depending on plural informationelements such as the prediction method, the size of the current block,and the prediction direction, and the inverse transform module 225 ofthe video decoding device performs the inverse transform on the basis ofthe transform information on the transform performed by the transformmodule of the video encoding device.

The prediction module 230 generates a prediction block on the basis ofprediction block creation information provided from the entropy decodingmodule 210 and the previously-decoded block and/or picture informationprovided from the memory 240.

When the prediction mode of a current PU is an intra prediction mode(intra mode), an intra prediction process of creating a prediction blockon the basis of pixel information in the current picture can beperformed.

When the prediction mode of a current PU is an inter prediction mode(inter mode), an inter prediction process can be performed on thecurrent PU on the basis of information included in at least one of aprevious picture or a subsequent picture of the current picture. At thistime, motion information necessary for the inter prediction of thecurrent PU provided from the video encoding apparatus, for example,information on motion vectors, reference picture indices, and the like,can be derived from a skip flag, a merge flag, and the like receivedfrom the encoder.

A reconstructed block is generated using the prediction block generatedby the prediction module 230 and the residual block provided from theinverse transform module 225. In FIG. 2, the prediction block and theresidual block are added to generate a reconstructed block by an adder.At this time, the adder may be considered as a particular module(reconstructed block creating module) that generates a reconstructedblock.

When the skip mode is applied, the residual block may be not betransmitted and the prediction block can be used as the reconstructedblock.

The reconstructed block and/or picture is provided to the filter module235. The filter module 235 performs a deblocking filtering process, anSAO (Sample Adaptive Offset) process, and/or an adaptive loop filteringprocess on the reconstructed block and/or picture.

The memory 240 stores the reconstructed picture or block for use as areference picture or a reference block and supplies the reconstructedpicture to the output module.

On the other hand, as described above, the filter modules of the encoderand the decoder can apply a deblocking filter, an ALF (Adaptive LoopFilter), or an SAO (Sample Adaptive Offset) as an in-loop filter.

The deblocking filter removes artifacts between blocks due to theprediction, transform, quantization in the unit of blocks. Thedeblocking filter is applied to a prediction unit edge or a transformunit edge and a predetermined smallest block size can be set forapplication of the deblocking filter.

In order to apply the deblocking filter, a boundary strength (BS) of ahorizontal or vertical filter boundary is first determined. Then, it isdetermined whether the filtering should be performed in the unit ofblocks on the basis of the BS. When it is determined that the filteringshould be performed, what filter should be applied is determined. Afilter to be applied can be selected from a weak filter and a strongfilter. The filter module applies the selected filter to the boundary ofthe corresponding block.

The ALF (Adaptive Loop Filter) may be performed after the SAO to bedescribed later is performed. The ALF functions to compensate for anencoding error using a Wiener filter and is globally applied to slicesunlike the SAO. The ALF may be performed in case of only HE (HighEfficiency).

The SAO is a procedure of reconstructing an offset difference of animage, which has been subjected to the deblocking filtering, from anoriginal image in the unit of pixels. A coding error can be compensatedfor through the SAO and the coding error may be based on quantization orthe like. The SAO is classified into two types of a band offset and anedge offset.

As described above, when an image (picture) is reconstructed in the unitof blocks (for example, CU, PU, and TU), block distortion may occur inthe boundaries between the reconstructed blocks. A deblocking filter canbe applied to prevent the block distortion. The deblocking filter can beselectively applied to a position at which the block distortion islikely to occur in the same image or picture and a position at which theblock distortion is not likely to occur. For example, the deblockingfilter can be applied in different ways to the position at which theblock distortion is likely to occur and the position at which the blockdistortion is not likely to occur.

For this purpose, boundary strength (hereinafter, referred to as “bS”)of a boundary between blocks can be determined depending on whether theboundary between blocks corresponds to a boundary to which thedeblocking filter should be applied, whether neighboring blocks areblocks having intra coding applied thereto, or the like, and thedeblocking filtering can be applied on the basis of the determined bS.

On the other hand, when a CU is an I_PCM CU, that is, when a CU is a PCM(Pulse Coding Modulation) to which intra prediction should be applied,the deblocking filtering is not performed. Since the I_PCM mode does notrequire the quantization and transform processes, the same values as theoriginal data are reconstructed.

Therefore, in order to reconstruct the best image quality (originalimage quality), the in-loop filter is not applied to a CU of the I_PCMmode (I_PCM CU). For example, in the deblocking filtering process, thedeblocking filter is prevented from being applied to the I_PCM CU bysetting the quantization parameter qP of the I_PCM CU to 0 (zero).

FIG. 3 is a flowchart schematically illustrating a method of applying adeblocking filter according to the invention. The deblocking filteringshown in FIG. 3 can be performed by an encoder and a decoder. Forexample, the filtering modules shown in FIGS. 1 and 2 can perform thedeblocking filtering process shown in FIG. 3.

The deblocking filtering is first applied to a vertical edge betweenblocks in a current picture and is then applied to a horizontal edgebetween blocks in the current picture. The deblocking filtering isapplied to the horizontal edge in the current picture with the modifiedsample by deblocking filtering of vertical edges.

Therefore, the deblocking filtering procedure illustrated in FIG. 3 canbe first applied to the vertical edge in the current picture and thencan be applied to the horizontal edge in the current picture.

Referring to FIG. 3 for the edge between blocks, a block boundary isderived for application of the deblocking filtering (S310).

The filter module sets the size of a current coding block or a currentLCU (Largest Coding Unit) (hereinafter, a coding block in thisdescription includes an LCU for the purpose of convenience forexplanation) and determines whether the boundary of the current codingblock is a boundary of a current picture, whether the boundary of thecurrent coding block is a boundary to which the deblocking filter isapplied as a boundary of a tile, and whether the boundary of the currentcoding block is a boundary to which the deblocking filter as a boundaryof a slice.

For example, when the deblocking filter is applied to a vertical edgeand the left boundary of the current coding block is the left boundaryof the current picture, the left boundary of the current coding blockcan be removed from the target of the deblocking filtering. When theleft boundary of the current coding block is the left boundary of thecurrent tile and a filter is determined not to be applied to the edge ofthe current tile or when the left boundary of the current coding blockis the left boundary of the current slice and a filter is determined notto be applied to the edge of the current slice, the left boundary of thecurrent coding block can be removed from the target of the deblockingfiltering. Therefore, otherwise, in application of the deblockingfiltering to the vertical edge, the deblocking filtering can be appliedto the left boundary of the current coding block.

When the deblocking filter is applied to a horizontal edge and the topboundary of the current coding block is the top boundary of the currentpicture, the top boundary of the current coding block can be removedfrom the target of the deblocking filtering. When the top boundary ofthe current coding block is the top boundary of the current tile and afilter is determined not to be applied to the edge of the current tileor when the top boundary of the current coding block is the top boundaryof the current slice and a filter is determined not to be applied to theedge of the current slice, the top boundary of the current coding blockcan be removed from the target of the deblocking filtering. Otherwise,in application of the deblocking filtering to the horizontal edge, thedeblocking filtering can be applied to the top boundary of the currentcoding block.

The application of the filtering to a boundary in this description meansthat the filtering is performed on predetermined samples located on bothsides of the boundary.

The filter module can derive block boundaries of vertical edges of atransform block and a prediction block when the deblocking filtering isapplied to a vertical edge of a picture, and can derive block boundariesof horizontal edges of the transform block and the prediction block whenthe deblocking filtering is applied to a horizontal edge of the picture.

When the edge of the transform block is an edge of a coding block, theboundary of the transform block can be derived for the correspondingedge depending on whether the deblocking filtering should be applied tothe corresponding edge. When the transform block is divided, theboundaries of the divided blocks can be derived.

The filter module can derive the boundary of each partition of aprediction block. For example, when the partitions of a prediction blockare 2N×N pixel blocks, N×N pixel blocks, 2N×nU pixels, or 2N×nD pixelblocks (where N, U, and D are an integer corresponding to the number ofpixels and n is an integer corresponding to the number of predictionblocks in a coding block), an edge for each partition can be derived.Subsequently, the bS of the block boundary to which the deblockingfilter should be applied is derived (S320). The bS is determined foreach edge in the current coding block. The bS is derived for eachvertical edge when the deblocking filtering is applied to the verticaledges in a picture, and the bS is derived for each horizontal edge whenthe deblocking filtering is applied to the horizontal edges in thepicture.

The derivation of the bS can be performed for each predetermined unit.For example, the bS may be derived for each edge of a transform block ormay be derived for each edge of a prediction block. The bS may bederived in the unit of blocks with a predetermined size, for example, inthe unit of 8×8 pixel blocks or 4×4 pixel blocks.

In addition, the bS may be derived for an edge of a block satisfying aspecific condition out of a transform block, a prediction block, and apredetermined-sized block in a current coding block. For example, the bSmay be derived for each larger block of the smaller block of a transformblock (for example, TU) and a prediction block (for example, PU) and apredetermined-size block (for example, 8×8 pixel block).

In other words, the bS can be determined in the unit of pixels (forexample, L pixel unit when the bS decision unit is a L×L pixel block (Lis an integer)) corresponding to the size of the block which serves as aunit for deciding the bS at the boundary of a block to be subjected tothe deblocking filtering. The specific derivation of the bS will bedescribed later.

Subsequently, a filtering process is performed on the block boundary onthe basis of the bS (S330).

For example, in case of luma samples, when the bS for a target edge isequal to or less than a predetermined reference bS, for example,bS_(th1), the deblocking filtering may not be applied to thecorresponding edge. In case of aroma samples, when the bS for a targetedge is equal to or less than a predetermined reference bS, for example,bS, the deblocking filtering may not be applied to the correspondingedge. The reference bS values bS_(th1) and bS_(th2) may be set to beequal to or different from each other.

In order to efficiently apply the deblocking filtering, an additionalthreshold value (referred to as Th1 for the purpose of conveninence forexplanation) may be set. For example, when the reference bS value is setto 0 and the bS value for a target edge is larger than 0, the ON/OFF ofthe deblocking filtering at the level of blocks can be determined usingTh1. For example, when the value derived from the target edge is largerthan Th1, the deblocking filtering may be applied to the target edge.

An example where the deblocking filtering is applied to vertical edgesin a picture will be first described. As the value derived from a targetvertical edge for the purpose of comparison with Th1, a differencebetween filtering target samples in two blocks with the vertical edge asa boundary in a specific sample row can be considered. For example, thesum DL_(k) of differences (the sum of a difference between the firstsample from the vertical edge and the second sample from the verticaledge and a difference between the third sample from the vertical edgeand the second sample from the vertical edge, for example, when threesamples from the vertical edge should be subjected to the filtering)between filtering target samples adjacent to the vertical edge in theleft block of the vertical edge out of the samples in the k-th samplerow (where k is an integer) can be calculated, and the sum DR_(k) ofdifferences (the sum of a difference between the first sample from thevertical edge and the second sample from the vertical edge and adifference between the third sample from the vertical edge and thesecond sample from the vertical edge, for example, when three samplesfrom the vertical edge should be subjected to the filtering) betweenfiltering target samples adjacent to the vertical edge in the rightblock of the vertical edge can be derived. The sum D_(k) of DL_(k) andDR_(k) can be compared with Th1 and the deblocking filtering can beapplied to the vertical edge when D_(k) is smaller than Th1. When D_(k)is smaller than Th1, it can be considered that the vertical boundary isnot a boundary (for example, an actual image boundary in an originalpicture) to which it is not effective to apply the deblocking filteringon the basis of the quantization parameter and it can be determined thata picture is reconstructed closer to the original picture by applyingthe deblocking filtering.

At this time, in two blocks with the vertical edge as a boundary, thesum of differences between neighboring filtering target samples inplural sample rows may be considered instead of considering the sum ofdifferences between neighboring filtering target samples in only onesample row. For example, in two blocks with the vertical edge as aboundary, when the sum D (=D_(k)+D_(k+j)) the sum D_(k) of differencesbetween filtering target samples in the k-th sample row and the sumD_(k+j) of differences between filtering target samples in the (k+j)-thsample row (where k is an integer) is smaller than the threshold valueTh1, it may be determined that the deblocking filter should be appliedto the vertical edge.

An example where the difference j between two sample rows is set to 3will be described below. When D (=D₂+D₅) for the second sample row andthe fifth sample row is smaller than Th1, the deblocking filter may beapplied to the corresponding vertical edge. When the difference jbetween two sample rows is set to 3 and the sum D (=D₀+D₃) for thezeroth sample row and the third sample row is smaller than Th1, thedeblocking filter may be applied to the corresponding vertical edge.

At this time, in order to effectively reflect characteristics of eachblock and each sample row, the D values which are the absolute values ofthe sums between differences between filtering target samples for eachsample row and each block may be derived. In this case, the D value forthe k-th sample row and the (k+j)-th sample row of the left block (L)and the right block (R) with the vertical edge as a boundary can bederived by Expression 1.

D=abs(DL _(k))+abs(DL _(k+j))+abs(DR _(k))+abs(DR _(k+j))  Expression 1

As described above, DL_(K) is the sum of differences between thefiltering target samples adjacent to the vertical edge in the k-thsample row of the left block. For example, when three samples adjacentto the vertical edge are the application target of the deblockingfiltering, DL_(K) can be derived by the sum of the difference betweenthe first sample from the vertical edge and the second sample from thevertical edge in the k-th sample row of the left block of the verticaledge and the difference between the third sample from the vertical edgeand the second sample from the vertical edge. DR_(K) is the sum ofdifferences between the filtering target samples adjacent to thevertical edge in the k-th sample row of the right block. For example,when three samples adjacent to the vertical edge are the applicationtarget of the deblocking filtering, DR_(K) can be derived by the sum ofthe difference between the first sample from the vertical edge and thesecond sample from the vertical edge in the k-th sample row of the rightblock of the vertical edge and the difference between the third samplefrom the vertical edge and the second sample from the vertical edge.

When the sum of differences between the adjacent filtering targetsamples is taken in consideration of plural sample rows as describedabove, the deblocking filtering can be more effectively applied byconsidering the sum of differences between the adjacent filtering targetsamples in each sample row. For example, D_(k) can be defined asexpressed by Expression 2 by referring to Expression 1 and consideringonly the k-th sample row.

D _(k)=abs(DL _(k))+abs(DR _(k))  Expression 2

For example, when the k-th sample row and the (k+3)-th sample row areconsidered for the vertical edge as described above and D is smallerthan Th1, and D_(k) for the k-th sample row and D_(k+3) for the (k+3)-thsample row are each smaller than a half of Th1 (Th1/2), strong filteringcan be applied to the vertical edge. On the other hand, when D issmaller than Th1 but D_(k) is not smaller than Th1/2 or D_(k+3) is notsmaller than Th1/2, weak filtering can be applied to the vertical edge.

When the weak filtering is applied, the filtering can be applied to onlyspecific samples out of the filtering target samples. In this case, afiltering coefficient other than that in the strong filtering may beapplied. For example, when the filtering target samples are six samples(three samples on the left side and three samples on the right side)located on the left and right sides of the vertical edge, the strongfiltering can be applied to all the filtering target samples and theweak filtering can be applied to two samples located on the left side ofthe target edge and two samples located on the right side of the targetedge. At this time, the filtering coefficients of the strong filteringand the weak filtering can be different from each other.

An example where the deblocking filtering is applied to horizontal edgesin a picture will be first described. As the value derived from a targethorizontal edge for the purpose of comparison with Th1, a differencebetween filtering target samples in two blocks with the horizontal edgeas a boundary in a specific sample column can be considered. Asdescribed in the example for the horizontal edge, the sum DT_(k) ofdifferences (the sum of a difference between the first sample from thehorizontal edge and the second sample from the horizontal edge and adifference between the third sample from the horizontal edge and thesecond sample from the horizontal edge, for example, when three samplesfrom the horizontal edge should be subjected to the filtering) betweenfiltering target samples adjacent to the horizontal edge in the topblock of the horizontal edge out of the samples in the k-th samplecolumn (where k is an integer) can be calculated, and the sum DB_(k) ofdifferences (the sum of a difference between the first sample from thehorizontal edge and the second sample from the horizontal edge and adifference between the third sample from the horizontal edge and thesecond sample from the horizontal edge, for example, when three samplesfrom the horizontal edge should be subjected to the filtering) betweenfiltering target samples adjacent to the horizontal edge in the bottomblock of the horizontal edge can be derived. The sum D_(k) of DL_(k) andDR_(k) can be compared with Th1 and the deblocking filtering can beapplied to the horizontal edge when D_(k) is smaller than Th1.

At this time, in two blocks with the horizontal edge as a boundary, thesum of differences between neighboring filtering target samples inplural sample columns may be considered. For example, in two blocks withthe horizontal edge as a boundary, when the sum D (=D_(k)+D_(k+j)) thesum D_(k) of differences between filtering target samples in the k-thsample column and the sum D_(k+j) of differences between filteringtarget samples in the (k+j)-th sample column (where k is an integer) issmaller than the threshold value Th1, it may be determined that thedeblocking filter should be applied to the horizontal edge.

An example where the difference j between two sample columns is set to 3will be described below. When D (=D₂+D₅) for the second sample columnand the fifth sample column is smaller than Th1, the deblocking filtermay be applied to the corresponding horizontal edge. When the differencej between two sample columns is set to 3 and the sum D (=D₀+D₃) for thezeroth sample column and the third sample column is smaller than Th1,the deblocking filter may be applied to the corresponding horizontaledge.

The sample rows considered for the vertical edge and the sample columnsconsidered for the horizontal edge may be sample rows and sample columnscorresponding to each other. For example, when the zeroth sample row andthe third-sample row are considered for the vertical edge, the zerothsample column and the third sample column can be considered for thehorizontal edge.

Similarly to the vertical edge, in order to effectively reflectcharacteristics of each block and each sample column, the absolutevalues of the sums between differences between filtering target samplesfor each sample column and each block may be taken. In this case, the Dvalue for the k-th sample column and the (k+j)-th sample column of thetop block (T) and the bottom block (B) with the horizontal edge as aboundary can be derived by Expression 3.

D=abs(DT _(k))+abs(DT _(k+j))+abs(DB _(k))+abs(DB _(k+j))  Expression 3

As described above, DT_(K) is the sum of differences between thefiltering target samples adjacent to the horizontal edge in the k-thsample column of the top block. For example, when three samples adjacentto the horizontal edge are the application target of the deblockingfiltering, DT_(K) can be derived by the sum of the difference betweenthe first sample from the horizontal edge and the second sample from thehorizontal edge in the k-th sample column of the top block of thehorizontal edge and the difference between the third sample from thehorizontal edge and the second sample from the horizontal edge. DB_(K)is the sum of differences between the filtering target samples adjacentto the horizontal edge in the k-th sample column of the bottom block.For example, when three samples adjacent to the horizontal edge are theapplication target of the deblocking filtering, DB_(K) can be derived bythe sum of the difference between the first sample from the horizontaledge and the second sample from the horizontal edge in the k-th samplecolumn of the bottom block of the horizontal edge and the differencebetween the third sample from the horizontal edge and the second samplefrom the horizontal edge.

As described in the example for the vertical edge, the deblockingfiltering can be more effectively applied by considering the sum ofdifferences between the adjacent filtering target samples in each samplecolumn. For example, D_(k) can be defined as expressed by Expression 4by referring to Expression 3 and considering only the k-th samplecolumn.

D _(k)=abs(DT _(k))+abs(DB _(k))  Expression 4

For example, when the k-th sample column and the (k+3)-th sample columnare considered for the horizontal edge as described above and D issmaller than Th1, and D_(k) for the k-th sample column and D_(k+3) forthe (k+3)-th sample column are each smaller than a half of Th1 (Th1/2),strong filtering can be applied to the horizontal edge. On the otherhand, when D is smaller than Th1 but D_(k) is not smaller than Th1/2 orD_(k)+₃ is not smaller than Th1/2, weak filtering can be applied to thehorizontal edge.

When the weak filtering is applied, the filtering can be applied to onlyspecific samples out of the filtering target samples. In this case, afiltering coefficient other than that in the strong filtering may beapplied. For example, when the filtering target samples are six samples(three samples on the top side and three samples on the bottom side)located on the top and bottom sides of the horizontal edge, the strongfiltering can be applied to all the filtering target samples and theweak filtering can be applied to two samples located on the top side ofthe target edge and two samples located on the bottom side of the targetedge. At this time, the filtering coefficients of the strong filteringand the weak filtering can be different from each other.

The strong filtering and the weak filtering may be applied to thevertical edges and the horizontal edges using the same method (forexample, the same filter coefficient or offset).

As described above, when it is determined whether the deblockingfiltering should be applied, which of the strong filter and the weakfilter should be applied, and to what sample the weak filter should beapplied, the filtering module can apply the deblocking filter on thebasis of a predetermined method (for example, the same filtercoefficient or offset). As described above, the deblocking filtering canbe first applied to the vertical edges in a picture and then thedeblocking filtering can be applied to the horizontal edges in thepicture.

FIG. 3 shows the method of applying the deblocking filtering in roughsteps such as the block boundary deriving step (S310), the bS derivingstep (S320), and the filtering application step (S330), but theabove-mentioned details from the bS decision to the filteringapplication can be divided into detailed steps.

For example, the following steps can be performed for the horizontaldeblocking filtering on the vertical edges in a picture: (1) decidingthe bS of a vertical edge in a coding block (which may be an LCU),wherein the bS decision target edge may be an edge of the smaller blockof TU and PU, may be an edge of a predetermined unit block (for example,8×8 pixel block), or may be an edge of the large block of the smallerunit block of TU and PU and the predetermined unit block; (2)determining ON/OFF of the deblocking filtering at the block level for anedge of which the bS is larger than 0, wherein predetermined sample rows(for example, the second sample row and the fifth sample row) in theblocks on both sides of the boundary (edge) can be used for this composeas described above; (3) determining which of the strong filtering andthe weak filtering should be applied to a region in which the filteringis turned on; (4) determining ON/OFF of additional filtering when theweak filtering is applied, wherein the ON/OFF of additional filteringincludes determining ON/OFF of filtering for each specific sample asdescribed above; and (5) repeatedly performing the above-mentioned stepson a next coding block (including LCU) in the current picture, whereinthe deblocking filtering process is performed on all the vertical edgesin the picture.

For example, the following steps can be performed for the verticaldeblocking filtering on the horizontal edges in a picture: (1) decidingthe bS of a horizontal edge in a coding block (which may be an LCU),wherein the bS decision target edge may be an edge of the smaller blockof TU and PU, may be an edge of a predetermined unit block (for example,8×8 pixel block), or may be an edge of the large block of the smallerunit block of TU and PU and the predetermined unit block; (2)determining ON/OFF of the deblocking filtering at the block level for anedge of which the bS is larger than 0, wherein predetermined samplecolumns (for example, the second sample column and the fifth samplecolumn) in the blocks on both sides of the boundary (edge) can be usedfor this purpose as described above; (3) determining which of the strongfiltering and the weak filtering should be applied to a region in whichthe filtering is turned on; (4) determining ON/OFF of additionalfiltering when the weak filtering is applied, wherein the ON/OFF ofadditional filtering includes determining ON/OFF of filtering for eachspecific sample as described above; and (5) repeatedly performing theabove-mentioned steps on a next coding block (including LCU) in thecurrent picture, wherein the deblocking filtering process is performedon all the horizontal edges in the picture.

FIG. 4 is a diagram schematically illustrating details of the deblockingfiltering according to the invention. Referring to FIG. 4, thedeblocking filtering (401) is performed on the edges in the cordingblock in the unit of coding blocks (for example, LCU). As describedabove, the deblocking filtering (horizontal filtering) for the verticaledges is performed on the whole current picture and then the deblockingfiltering (vertical filtering) for the horizontal edges is performed onthe whole current picture.

FIG. 5 is a flowchart schematically illustrating an example of the bScalculating method.

For the purpose of convenience for explanation, in this description, thecurrent block in the deblocking filtering is represented by Q, and ablock adjacent to the current block and earlier encoded/decoded than thecurrent block is represented by P. For example, when the deblockingfiltering is performed on a vertical edge, the left block of thevertical edge is represented by P and the right block thereof isrepresented by Q. When the deblocking filtering is performed on ahorizontal edge, the top block of the horizontal edge is represented byP and the bottom block thereof is represented by Q.

Referring to FIG. 5, in order to determine the bS, it is determinedwhether P and/or Q is intra-coded (S510).

When P and/or Q is intra-coded, it is determined whether the boundarybetween P and Q is a boundary of a CU (S520). At this time, the boundaryof a CU may be a boundary of an LCU.

When it is determined in step S520 that the boundary between P and Q isthe boundary of a CU, the bS value of the boundary between P and Q isdetermined to be 4 (S530).

When it is determined in step S520 that the boundary between P and Q isnot the boundary of a CU, the bS value of the boundary between P and Qis determined to be 3 (S540).

When P and/or Q is not intra-coded, it is determined whether P and/or Qincludes a coefficient (transform coefficient) other than 0 (S550). Atthis time, the filter module can determine whether a transformcoefficient other than 0 is present on the basis of the transformcoefficient which has not been dequantized. The filter module maydetermine whether a transform coefficient other than 0 is present on thebasis of the transform coefficient which has been dequantized.

When it is determined in step S550 that P and/or Q includes acoefficient (transform coefficient other than 0), the bS value of theboundary between P and Q is determined to be 2 (S560).

When it is determined in step S550 that P and/or Q does not include acoefficient (transform coefficient other than 0), it is determinedwhether P and Q have different reference pictures or different motionvectors (S570).

When it is determined in step S570 that P and Q have different referencepictures or different motion vectors, the bS value of the boundarybetween P and Q is determined to be 1 (S580).

Otherwise, that is, when the deblocking filtering should not beperformed, the bS value of the boundary between P and Q is set to 0(S590). In FIG. 5, a case where the above-mentioned conditions are notsatisfied at all is shown as an example where the bS is not applied.

On the other hand, the values of coefficients necessary for thedeblocking filtering may be set depending on the bS values.

The parameter T_(C)offset shown in FIG. 5 can be mentioned as anexample. T_(C)offset is a parameter set by a user so as to determine thevalues of T_(C) optimized for image characteristics. T_(C) is one ofthreshold values used to determine a parameter associated with thedeblocking filtering by quantifying blocking artifacts corresponding tothe degree of quantization.

FIG. 5 illustrates an example where T_(C)offset is set to 0 when the bSvalue is 0, 1, or 2 and is set to 2 when the bS value is 3 or 4.

On the other hand, in order to effectively apply the deblockingfiltering, the unit block and the decision method for deciding the bSvalue, which have been described with reference to FIGS. 3 and 5, may bemodified and applied.

The bS values can be determined by units equal to or smaller than theactual deblocking filtering unit block.

For example, when the actual deblocking filtering is performed on lumasamples in the unit of 8×8 pixels, the bS values can be determined inthe unit of 4×4 pixels. In this way, when the size of the deblockingfiltering unit block is larger than the size of the bS decision unitblock, the bS values of only the boundaries corresponding to theboundaries (edges) of the deblocking filtering unit block out of theboundaries (edges) of the bS decision unit blocks can be determined. Inother words, when the bS is determined by L×L pixel blocks (where L isan integer), the bS values of the boundaries of the deblocking filteringunit block are determined in the unit of L pixels.

Specifically, the block unit in which the bS is determined is a 4×4pixel block and the actual deblocking filtering is performed in the unitof 8×8 pixel blocks. That is, the bS value is determined in the unit of4 pixels for the boundary of the 8×8 pixel block which is the deblockingfiltering unit block Therefore, the bS values of the edges of 4×4 pixelblocks in the 8×8 pixel block which is a deblocking filtering unit blockdo not have to be determined.

FIG. 6 is a diagram illustrating a target boundary for the deblockingfiltering when a deblocking filtering unit block is an 8×8 pixel blockand the bS decision unit block is a 4×4 pixel block.

As shown in the drawing, the bS values of the boundaries located insidethe deblocking filtering unit block out of the boundaries of the bSdecision unit block may not be determined.

In order to simplify the bS decision process and to reduce complexity, arepresentative bS value of edges of the deblocking filtering unit blockmay be determined.

FIG. 7 is a diagram schematically illustrating an example of a method ofdeciding a representative bS value of a deblocking filtering unit blockFIG. 7 shows an example where a deblocking filtering unit block 700 isan 8×8 pixel block and a bS decision unit block is a 4×4 pixel block.

Referring to FIG. 7, the vertical edges and the horizontal edges whichare the boundaries of the deblocking filtering unit block 700 arepresent as the boundaries (edges) of the 4×4 pixel block which is the bSdecision unit block in the deblocking filtering unit block 700.

The vertical edge will be described as an example. Two vertical edges710 and 720 of which the bS should be determined are present in thedeblocking filtering unit block 700. In the example shown in FIG. 7, thelarger bS value of the bS value of the first vertical edge 710 and thebS value of the second vertical edge 720 is determined as therepresentative bS value of the vertical edges of the deblockingfiltering unit block 700.

For example, when the bS value of the first vertical edge 710 is 1 andthe bS value of the second vertical edge 720 is 2, 2 which is the basvalue of the second vertical edge 720 can be determined to be therepresentative bS value of the vertical edges which are the leftboundaries of the deblocking filtering unit block 700.

In FIG. 7, the vertical edges are described as an example for thepurpose of convenience for explanation, but the same method can beapplied to the horizontal edges. For example, the bS values of two edgeswhich are the top boundaries of the 4×4 pixel blocks in the deblockingfiltering unit block 700 are derived as the top boundary of thedeblocking filtering unit block 700, and the larger bS value can bedetermined to be the representative bS value of the horizontal edgeswhich are the top boundary of the deblocking filtering unit block 700.

When the two bS values are equal in the example shown in FIG. 7, any oneof the two bS values can be used as the representative bS value.

In order to simplify the bS decision process to reduce complexity and toenhance the deblocking filtering effect, a method of deriving only thebS value of one edge out of the edges of the deblocking filtering unitblock may be considered.

FIG. 8 is a diagram schematically illustrating another example of themethod of deciding the representative bS value in a deblocking filteringunit block. FIG. 8 shows an example where a deblocking filtering unitblock 800 is an 8×8 pixel block and a bS decision unit block is a 4×4pixel block.

Referring to FIG. 8, unlike the example shown in FIG. 7, the bS value ofthe zeroth edge 810 out of two vertical edges 810 and 820 of which thebS value should be determined in the deblocking filtering unit block 800is determined. In other words, the bS values of only the vertical edgeand the horizontal edge of the zeroth bS decision unit block aredetermined for each deblocking unit block, and the calculated bS valueis used as the representative bS value of the corresponding deblockingfiltering unit block. For example, when the deblocking filtering unitblock is an 8×8 pixel block and the bS decision unit block is a 4×4pixel block, four bS decision unit blocks are present in the deblockingfiltering unit block. The bS values of only the vertical edge and thehorizontal edge of the zeroth block (top-left block) can be determinedand can be used as the representative bS value of the deblockingfiltering unit block.

When the bS values are determined as shown in FIG. 8, the bS decisionprocess can be simplified, the bS values can be determined through aprocess corresponding to ¼ of the existing process, and the memorycapacity for storing the bS values can be reduced by ¼.

On the other hand, in addition to the method of simplifying the bSdecision process in consideration of the bS decision unit block, the bSdecision process may be simplified in consideration of the bS decisionprocedure (bS decision tree) shown in FIG. 5. Even when the bS value isfinely divided into from 0 to 4 as in the example shown in FIG. 5, thedeblocking filtering process may not use the divided bS values. Forexample, it may be determined whether bS>0 is satisfied, bS>1 issatisfied, or bS>2 is satisfied.

Therefore, the bS decision tree shown in FIG. 5 may be furthersimplified to perform the deblocking filtering.

FIG. 9 is a flowchart schematically illustrating another example of thebS decision method.

Referring to FIG. 9, it is determined whether P and/or Q is intra-coded(S910).

When P and/or Q is intra-coded, it is determined whether the boundarybetween P and Q is determined to be bS3 (S920).

When it is not the case that P and/or Q is intra-coded, it is determinedwhether P and/or Q includes a coefficient (transform coefficient otherthan 0) (S930). At this time, the transform coefficient may be atransform coefficient which has not been dequantized or may be atransform coefficient which has been dequantized.

When it is determined in step S930 that P and/or Q includes acoefficient (transform coefficient other than 0), the bS value of theboundary between P and Q is determined to be bS2 (S940).

When the case determined in step S930 is not the case that P and/or Qincludes a coefficient (transform coefficient other than 0), it isdetermined whether P and Q have different reference pictures ordifferent motion vectors (S950).

When it is determined in step S950 that P and Q have different referencepictures or different motion vectors, the bS value of the boundarybetween P and Q is determined to be bS1 (S960).

Otherwise, that is, when the deblocking filtering should not beperformed, the bS value of the boundary between P and Q is set to bS0(S970).

Here, the bS values determined in steps S920, S940, S960, and S970 arerepresented by bS3, bS2, bS1, and bS0, which are intended for thepurpose of convenience for explanation. When it is considered that thebS values are classified into four types in the example shown in FIG. 9,the values bS0 to bS3 can be set to bS0=0, bS1=1, bS2=2, and bS3=3/4 (3and 4) as shown in FIG. 9. In the example shown in FIG. 9, bS3 isdetermined to be 3/4 (3 and 4) in step S920, which is intended to easilyunderstand that the bS values of 3 and 4 in the example shown in FIG. 5are determined to be a single value (for example, 3) of bS3 in theexample shown in FIG. 9.

The values of a parameter necessary for the deblocking filtering may beset using the bS decision tree. FIG. 9 shows an example whereT_(C)offset is set to a specific value (for example, 2) for the largestbS value and is set to 0 for the other bS values.

A method of further reducing the number of decision branches thandescribed in the example of FIG. 9 may be considered. In this case, thenumber of bS values can be reduced to three (bS0, bS1, and bS2) insteadof four (bS0, bS1, bS2, and bS3) as in the FIG. 9 to perform thedeblocking filtering.

In this case, the bS value is determined to be the largest bS2 when Pand/or Q is intra-coded, the bS value is determined to be bS1 when thedeblocking filtering can be applied besides the case of bS2, and the bSvalue is determined to be bS0 when the deblocking filtering cannot beapplied. In consideration of derivation of three bS values, the valuesof bS0, bS1, and bS2 can be set to bS0=0, bS1=1, and bS2=2.

FIG. 10 is a flowchart schematically illustrating the method of settingthe bS value to any one of three values as described above.

Referring to FIG. 10, it is determined whether P and/or Q is intra-coded(S1110).

When P and/or Q is intra-coded, the bS of the boundary between P and Qis determined to be bS2 (S1020). The bS2 corresponds to the case wherethe bS value is 3 and 4 (bS=3/4) in the example of FIG. 5. Since thelargest value of three bS values is bS2, the value bS2 can be set to,for example, 2.

When it is not the case that P and/or Q is intra-coded, it is determinedwhether P and Q include a coefficient (transform coefficient) other than0, whether P and Q have different reference pictures, or whether P and Qhave different motion vectors, etc. (S1030). At this time, the transformcoefficient may be a transform coefficient which has not beendequantized or may be a transform coefficient which has beendequantized.

When it is determined in step S1030 that P and Q include a coefficient(transform coefficient) other than 0, P and Q have different referencepictures, or P and Q have different motion vectors, the bS of theboundary between P and Q is set to bS1 (S1040). The value of bS1 is thebS value when P and Q are not intra-coded and the deblocking filter isapplied, and corresponds to the case where the bS value is 1 and 2(bS=1/2) in the example shown in FIG. 5. Since the middle value of threebS values is bS1, the value of bS1 can be set to, for example, 1.

Otherwise, that is, when the deblocking filtering is not performed, thebS value is set to bS0 (S1050). The value of bS0 is the bS value whenthe deblocking filter is not applied, and corresponds to the case wherethe bS value is 0 (bS=0) in the example shown in FIG. 5. Since thesmallest value of three bS values is bS0, the value of bS0 can be setto, for example, 0.

The values of a parameter necessary for the deblocking filtering may beset using the bS decision tree. FIG. 10 shows an example whereT_(C)offset is set to a specific value (for example, 2) for the largestbS value and is set to 0 for the other bS values.

On the other hand, block-based motion compensation is one principalreason for causing blocking artifacts in a block boundary. In order toovercome this problem, OBMC (Overlapped Block Motion Compensation) canbe used.

When the OBMC is used, the above-mentioned bS decision process needs tobe modified to be suitable for the OBMC. For example, when motioninformation varies between blocks, blocking artifacts may increase.Accordingly, similarity of motion information can be said to be onereference for determining 0 and 1 as the bS values. However, when theOBMC technique is used, block artifacts at the boundary of an area onwhich motion compensation is performed are reduced. As a result,unnecessary deblocking filtering can be reduced, but the bS decisionprocess (bS decision tree) needs to be modified in considerationthereof.

FIG. 11 is a flowchart schematically illustrating the bS decision methodas an example of the bS decision tree which is applied at the time ofapplication of the OBMC.

Referring to FIG. 11, it is first determined whether P and/or Q isintra-coded (S1100).

When P and/or Q is intra-coded, it is determined whether the boundary ofQ, that is, the boundary between P and Q is a boundary of a coding block(S1110). At this time, the coding block includes a CU and an LCU.

When it is determined in step S1110 that the boundary between P and Q isa boundary of a coding block, the bS value of the boundary between P andQ is determined to be bS4 (S1120).

When it is determined in step S1110 that the boundary between P and Q isnot a boundary of a coding block, the bS value of the boundary between Pand Q is determined to be bS3 (S1130).

When it is determined in step S1100 that P and Q are not intra-coded, itis determined whether P and Q are present inside a rectangular orasymmetric partition in a single coding block (for example CU) (S1140).

When it is determined in step S1140 that P and Q are not present insidea rectangular or asymmetric partition in a single coding block (forexample CU), it is determined whether P and/or Q include a coefficient(a transform coefficient other than 0) (S1150). At this time, thetransform coefficient may be a transform coefficient which has not beendequantized or may be a transform coefficient which has beendequantized.

When it is determined in step S1150 that P and/or Q include acoefficient (a transform coefficient other than 0), the bS of theboundary between P and Q is determined to be bS2 (S1160).

When it is determined in step S1150 that P and/or Q do not include acoefficient (a transform coefficient other than 0), it is determinedwhether P and Q have different reference pictures or motion vectors(S1170).

When it is determined in step 1170 that P and Q have different referencepictures or motion vectors, the bS of the boundary between P and Q isdetermined to be bS1 (S1180).

Otherwise, that is, when the deblocking filtering should not beperformed, the bS value is set to bS0 (S1190). The bS is set to bS0 whenit is determined in step S1140 that P and Q are not present inside arectangular or asymmetric partition in a single coding block (forexample, CU) or when it is determined in step S1170 that P and Q do nothave different reference pictures or motion vectors.

In the example shown in FIG. 11, similarly to the above-mentionedexamples of the bS decision method, the relationship ofbS4>bS3>bS2>bS1>bS0 is maintained. Therefore, the values of bS0 to bS4can be set to bS4=4, bS3=3, bS2=2, bS1=1, and bS0=0, as shown in thedrawing.

similarly to the above-mentioned examples, the values of a parameternecessary for the deblocking filtering may be set using the bS decisiontree. FIG. 11 shows an example where T_(C)offset is set to a specificvalue (for example, 2) for the largest two bS values and is set to 0 forthe other bS values.

In the example shown in FIG. 11, when P and Q are present in a singlecoding block (for example, a CU) and are present inside a rectangularpartition (for example, a prediction block and a PU) or in an asymmetricpartition (for example, a prediction block and a PU), the bS value ofthe boundary between P and Q can be determined to be 0.

Otherwise, when P and Q are present in a single coding block (forexample, a CU) and are present inside a rectangular partition (forexample, a prediction block and a PU) or in an asymmetric partition (forexample, a prediction block and a PU) but there is a large differencebetween motion information of P and motion information of Q, the bSvalue of the boundary between P and Q may be determined to be 1. Whenthere is a small difference between the motion information of P and themotion information of Q, the bS value of the boundary between P and Qmay be determined to be 0.

FIG. 12 is a flowchart schematically illustrating the bS decision methodas another example of the bS decision tree which is applied at the timeof application of the OBMC.

Referring to FIG. 12, it is first determined whether P and/or Q isintra-coded (S1200).

When P and/or Q is intra-coded, it is determined whether the boundary ofQ, that is, the boundary between P and Q is a boundary of a coding block(S1210). At this time, the coding block includes a CU and an LCU.

When it is determined in step S1210 that the boundary between P and Q isa boundary of a coding block, the bS value of the boundary between P andQ is determined to be bS4 (S1220).

When it is determined in step S1230 that the boundary between P and Q isnot a boundary of a coding block, the bS value of the boundary between Pand Q is determined to be bS3 (S1230).

When it is determined in step S1200 that P and Q are not intra-coded, itis determined whether P and Q are present in a rectangular or asymmetricpartition in a single coding block (for example a CU) (S1240).

When P and Q are not present inside a rectangular or asymmetricpartition in a single coding block (for example, CU), it is determinedwhether P and/or Q include a coefficient (transform coefficient otherthan 0) (S1250). At this time, the transform coefficient may be atransform coefficient which has not been dequantized or may be atransform coefficient which has been dequantized.

When it is determined in step S1250 that P and/or Q include acoefficient (a transform coefficient other than 0), the bS value of theboundary between P and Q is determined to be bS2 (S1260).

When it is determined in step S1240 that P and Q are present inside arectangular or asymmetric partition in a single coding block (forexample, CU) or when it is determined in step S1250 that P and/or Q donot include a coefficient (a transform coefficient other than 0), it isdetermined whether P and Q have different reference pictures or motionvectors (S1270).

When it is determined in step S1270 that P and Q have differentreference pictures or motion vectors, the bS value of the boundarybetween P and Q is determined to be bS1 (S1280).

Otherwise, that is, when the deblocking filtering should not beperformed, the bS value is set to bS0 (S1290).

In the example shown in FIG. 12, similarly to the above-mentionedexamples of the bS decision method, the relationship ofbS4>bS3>bS2>bS1>bS0 is maintained. Therefore, the values of bS0 to bS4can be set to bS4=4, bS3=3, bS2=2, bS1=1, and bS0=0, as shown in thedrawing.

As described above, in the example shown in FIG. 12, even when P and Qare present in a single coding block (for example, a CU) and are presentinside a rectangular partition (for example, a prediction block and aPU) or in an asymmetric partition (for example, a prediction block and aPU), the bS value of the boundary between P and Q can be determined tobe bS1 (for example, bS1=1).

Similarly to the above-mentioned examples, the values of a parameternecessary for the deblocking filtering may be set using the bS decisiontree. FIG. 12 shows an example where T_(C)offset is set to a specificvalue (for example, 2) for the largest two bS values and is set to 0 forthe other bS values.

On the other hand, when P and/or Q is intra-coded, the bS values may nothave to be divided. For example, as in the example shown in FIG. 5, 11,or 12, it is assumed that it is determined whether a target boundary inan I slice (intra-coded slice) is a boundary of a coding block (forexample, a CU), the bS value is determined to be 4 when thedetermination result is affirmative, and the bS value is determined tobe 3 when the determination result is negative. In this case, the bSvalues in all the I slices are 3 or 4.

In this regard, when the method of modifying the bS decision tree toreduce complexity is applied as shown in FIG. 10, the bS value may besimply applied depending on whether the bS value is larger than 0 orlarger than 1 or 2. Therefore, the bS value of 3 or 4 may not have to bedistinguished.

FIG. 13 is a diagram schematically illustrating an example of the methodof deciding a bS value to apply the deblocking filtering.

Referring to FIG. 13, the bS value is determined to apply the deblockingfiltering (S1310), ON/OFF of block-based filtering is determined on thebasis of the determined bS value (S1320), it is determined whether astrong filter or a weak filter should be applied to a predetermined bSvalue (S1330), and the filtering operation is then performed on thebasis thereof (S1340).

In the example shown in FIG. 13, the method of applying the deblockingfilter is identical or similar to the method described with reference toFIG. 3.

In the bS decision step (S1310), as shown in FIG. 5, 11, or 12, when theP and/or Q is intra-coded, the bS value may be determined by determiningwhether the target boundary is a boundary of a coding block.

FIG. 14 is a diagram schematically illustrating another example of themethod of deciding a bS value to apply the deblocking filtering. In FIG.14, unlike the example shown in FIG. 13, when P and/or Q is intra-coded(I slice), the bS value is not additionally distinguished anddetermined.

Referring to FIG. 14, it is determined whether P and/or Q is intra-coded(I slice) in order to apply the deblocking filtering (S1410).

When P and/or Q is not intra-coded, the general bS decision step asshown in FIG. 13 is performed (S1420).

When P and/or Q is intra-coded (I slice), the bS value is determined tobe a single value (for example, 4) unlike the example shown in FIG. 13(S1430).

Subsequently, ON/OFF of block-based filtering is determined on the basisof the determined bS value (S1440), it is determined whether a strongfilter or a weak filter should be applied to a predetermined bS value(S1450), and the filtering operation is then performed on the basisthereof (S1460).

In addition to the example shown in FIG. 14, the method using arepresentative bS value described in the example shown in FIG. 7 may bemodified to perform the deblocking filtering, as another method ofmodifying a applying the above-mentioned deblocking filtering method.

In the example shown in FIG. 7, when the deblocking filtering isperformed by 8×8 pixel blocks, the larger bS value of two bS valuesdetermined in the unit of 4×4 pixel blocks is used as a representativebS value.

FIG. 15 is a flowchart schematically illustrating an example of themethod of deciding a representative bS value.

Referring to FIG. 15, the magnitudes of bS1 and bS2 in a deblockingfiltering unit block are compared to select the representative bS value(S1510).

When it is determined in step S1510 that bS1 is larger than bS2, therepresentative bS value is set to bS1 (S1520). On the other hand, whenit is determined in step S1510 that bS2 is larger than bS1, therepresentative bS value is set to bS2 (S1530).

Here, bS1 and bS2 may be bS values of two vertical edges in thedeblocking filtering unit block or may be bS values of two horizontaledges. The method shown in FIG. 15 may be performed in the deblockingfiltering process on the vertical edges to determine the representativebS value of the vertical edges and then may be performed in thedeblocking filtering process on the horizontal edges to determine therepresentative bS value of the horizontal edges.

The filter module can perform the deblocking filtering using thedetermined representative bS value.

The example shown in FIG. 15 shows that the larger bS value is used asthe representative bS value as in the example shown in FIG. 7.Otherwise, the method of deciding a representative bS value may bechanged to reduce excessive deblocking filtering and to reduce acomputational load.

FIG. 16 is a flowchart schematically illustrating another example of themethod of deciding a representative bS value.

Referring to FIG. 16, the magnitudes of bS1 and bS2 in a deblockingfiltering unit block are compared to select the representative bS value(S1610).

When it is determined in step S1610 that bS1 is smaller than bS2, therepresentative bS value is set to bS1 (S1620). On the other hand, whenit is determined in step S1610 that bS2 is smaller than bS1, therepresentative bS value is set to bS2 (S1630).

Here, bS1 and bS2 may be bS values of two vertical edges in thedeblocking filtering unit block or may be bS values of two horizontaledges. The method shown in FIG. 16 may also be performed in thedeblocking filtering process on the vertical edges to determine therepresentative bS value of the vertical edges and then may be performedin the deblocking filtering process on the horizontal edges to determinethe representative bS value of the horizontal edges.

The filter module can perform the deblocking filtering using thedetermined representative bS value.

FIG. 17 is a flowchart schematically illustrating a video encodingmethod according to the invention.

Referring to FIG. 17, in the encoding method, an encoder divides aninput picture and perform a prediction operation on a current block(S1710). The prediction operation on the current block can be performedby a prediction module of the encoder. The prediction module may performan intra prediction or an inter prediction on the current block. Inconsideration of RDO (Rate Distortion Optimization) or the like, it canbe determined which of the intra prediction and the inter predictionshould be performed.

When a skip mode is not applied, the prediction module generates aprediction signal and generates a residual signal which is a differencebetween an original signal and the prediction signal.

The encoder transforms and quantizes the residual signal (S1720). Thetransform of the residual signal can be performed by a transform moduleand the quantization of the transformed signal (for example, transformcoefficients) can be performed by a quantization module.

The transformed and quantized signal is transmitted after undergoing anentropy encoding process.

The encoder dequantizes and inversely transforms the transformed andquantized signal to reconstruct the current block (S1730). Thedequantized and inversely-transformed signal is added to the residualsignal to reconstruct the original signal.

The encoder can apply the deblocking filtering on the reconstructedsignal (S1740). The reconstructed signal can be reconstructed to asignal closer to the original signal by the deblocking filtering. Thedeblocking filtering can be performed by the filter module. The filtermodule may apply the SAO (Sample Adaptive Offset) after applying thedeblocking filter.

The specific details of the deblocking filtering are the same asdescribed above with reference to the accompanying drawings.

The signal to which the deblocking filtering has been applied may bestored in a method such as a DPB (Decoded Picture Buffer) and may bereferred to for predicting other blocks or other pictures.

It has been described herein that a residual signal is generated byprediction and is transmitted, but the residual signal is notgenerated/transmitted when the skip mode is applied.

FIG. 18 is a flowchart schematically illustrating a video decodingmethod according to the invention.

Referring to FIG. 18, a decoder performs an entropy decoding operationon a received bitstream and performs a prediction operation on a currentblock (S1810). The prediction process on the current block can beperformed by a prediction module of the decoder. The prediction moduleperforms an inter prediction or an intra prediction on the current blockon the basis of information signaled from the encoder. The predictionmodule generates a prediction signal (prediction block) of the currentblock through the prediction.

The decoder reconstructs the current block on the basis of theprediction of the current block (S1820). The decoder generates aresidual signal (residual block) from the bitstream received from theencoder through the use of dequantization/inverse transform and adds theprediction signal (prediction block) and the residual signal (residualblock) to reconstruct a reconstructed signal (reconstructed block). Whenthe skip mode is applied, the residual signal is not transmitted and theprediction signal can be used as the reconstructed signal.

The decoder performs the deblocking filtering on the reconstructedsignal (reconstructed block) (S1830). The deblocking filtering can beperformed by a filter module of the decoder. The filter module appliesthe deblocking filter of the reconstructed block to modify thereconstructed block to be closer to the original block.

The specific details of the deblocking filtering are the same asdescribed above with reference to the accompanying drawings.

The filter module may apply the SAO (Sample Adaptive Offset) to thereconstructed block on the basis of information received from theencoder after applying the deblocking filter.

The signal reconstructed by the filter module may be stored in a methodsuch as a DPB (Decoded Picture Buffer) and may be referred to forpredicting other blocks or other pictures or may be output as areconstructed image.

It should be noted that FIGS. 17 and 18 are provided to schematicallyillustrate the application of the deblocking filtering according to theinvention to the encoding/decoding processes, for the purpose of easyunderstanding of the invention, and the encoding/decoding processesdescribed in detail with reference to the accompanying drawings can beperformed together therewith.

While the methods in the above-mentioned exemplary system have beendescribed on the basis of flowcharts including a series of steps orblocks, the invention is not limited to the order of steps and a certainstep may be performed in a step or an order other than described aboveor at the same time as described above. The above-mentioned embodimentscan include various examples. Therefore, the invention includes allsubstitutions, corrections, and modifications belonging to the appendedclaims.

When it is mentioned above that an element is “connected to” or “coupledto” another element, it should be understood that still another elementmay be interposed therebetween, as well as that the element may beconnected or coupled directly to another element. On the contrary, whenit is mentioned that an element is “connected directly to” or “coupleddirectly to” another element, it should be understood that still anotherelement is not interposed therebetween.

1. (canceled)
 2. An apparatus of decoding video applying deblockingfiltering, the apparatus comprising: dequantization module fordequantizing entropy decoded video information to output transformcoefficients; transform module for transforming the transformcoefficients into residual samples; prediction module for producingprediction samples based on a inter prediction or a intra prediction;and filtering module for performing a deblocking filtering onreconstructed samples along a boundary of a deblocking filtering unit,wherein the reconstructed samples are derived using the residual samplesand the prediction samples, wherein the filtering module derives aboundary strength (bS) of a bS setting unit in the current picture;determines whether deblocking filtering is to be applied when thederived bS is larger than 0; determines whether strong filtering is tobe applied or weak filtering is to be applied when the deblockingfiltering is determined to be applied; and applies a strong filtering ora weak filtering according to the determination on whether strongfiltering is to be applied or weak filtering is to be applied, whereinthe bS is derived for the boundary of the bS setting unit which overlapsa boundary of the deblocking filtering unit, and wherein the deblockingfiltering unit is an 8×8 pixel block and the bS setting unit is a 4×4pixel block.
 3. The apparatus of claim 2, wherein the filtering modulesets the bS value equal to 2 when at least one of two blocks facing eachother across the boundary in the current block is a intra coded block,sets the bS value equal to 1 when both of the two blocks facing eachother are not intra coded and the boundary in the current block is aboundary to be filtered, and sets the bS value equal to 0 when theboundary in the current block is not a boundary to be filtered.
 4. Theapparatus of claim 3, wherein the filtering module sets the bS valueequal to 1 when at least one of the two blocks facing each other acrossthe boundary in the current
 5. The apparatus of claim 2, wherein thefiltering module performs the deblocking filtering on the reconstructedsamples for vertical boundaries and then for horizontal boundaries. 6.The apparatus of claim 2, wherein the filtering module determineswhether strong filtering is to be applied or weak filtering is to beapplied on the basis of samples of two blocks facing each other acrossthe boundary in the current coding block.
 7. The apparatus of claim 6,wherein the filtering module determines whether the strong filtering isto be applied or the weak filtering is to be applied on the basis ofsamples to be subjected to the filtering out of samples in sample rowswhen the boundary in the current coding block is vertical, or on thebasis of samples to be subjected to the filtering out of samples insample columns when the boundary in the current coding block ishorizontal.
 8. The apparatus of claim 7, wherein samples in k-th samplerow (k is integer and 0≦k) and (k+3)-th sample row are used fordetermining whether the strong filtering is to be applied or the weakfiltering is to be applied when the boundary in the current coding blockis vertical, or samples in k-th sample column and (k+3)-th sample columnare used for determining whether the strong filtering is to be appliedor the weak filtering is to be applied when the boundary in the currentcoding block is horizontal.
 9. The apparatus of claim 7, whereindifferences between samples within third from the boundary in thecurrent coding unit is used for determining whether the strong filteringis to be applied or the weak filtering is to be applied.
 10. A method ofdecoding video applying deblocking filtering, the method comprising:dequantizing entropy decoded video information to output transformcoefficients; transforming the transform coefficients into residualsamples; producing prediction samples based on a inter prediction or aintra prediction; and performing a deblocking filtering on reconstructedsamples along a boundary of a deblocking filtering unit, wherein thereconstructed samples are derived using the residual samples and theprediction samples, wherein the step of performing the deblockingfiltering includes deriving a boundary strength (bS) of a bS settingunit in the current picture; determining whether deblocking filtering isto be applied when the derived bS is larger than 0; determining whetherstrong filtering is to be applied or weak filtering is to be appliedwhen the deblocking filtering is determined to be applied; and applyinga strong filtering or a weak filtering according to the determination onwhether strong filtering is to be applied or weak filtering is to beapplied, wherein the bS is derived for the boundary of the bS settingunit which overlaps a boundary of the deblocking filtering unit, andwherein the deblocking filtering unit is an 8×8 pixel block and the bSsetting unit is a 4×4 pixel block.